FUNCTION gngd() implements the GNGD algorithm Based on the paper "A generalized normalized gradient descent algorithm", IEEE Signal Processing Letter, vol. 11, no. 2, 2004. INPUT: x: input signal which should be scaled according to the dynamic range of nonlinearity N: filter length mu: step-size C: regularization parameter rho: step-size of adaptation of regularization parameter OUTPUT: y: filter output Complex Valued Nonlinear Adaptive Filtering toolbox for MATLAB Supplementary to the book: "Complex Valued Nonlinear Adaptive Filters: Noncircularity, Widely Linear and Neural Models" by Danilo P. Mandic and Vanessa Su Lee Goh (c) Copyright Danilo P. Mandic 2009 http://www.commsp.ee.ic.ac.uk/~mandic %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You can obtain a copy of the GNU General Public License from http://www.gnu.org/copyleft/gpl.html or by writing to Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ...........................................
0001 % FUNCTION gngd() implements the GNGD algorithm 0002 % 0003 % Based on the paper "A generalized normalized gradient descent algorithm", 0004 % IEEE Signal Processing Letter, vol. 11, no. 2, 2004. 0005 % 0006 % INPUT: 0007 % x: input signal which should be scaled according to the dynamic range of nonlinearity 0008 % N: filter length 0009 % mu: step-size 0010 % C: regularization parameter 0011 % rho: step-size of adaptation of regularization parameter 0012 % 0013 % OUTPUT: 0014 % y: filter output 0015 % 0016 % 0017 % Complex Valued Nonlinear Adaptive Filtering toolbox for MATLAB 0018 % Supplementary to the book: 0019 % 0020 % "Complex Valued Nonlinear Adaptive Filters: Noncircularity, Widely Linear and Neural Models" 0021 % by Danilo P. Mandic and Vanessa Su Lee Goh 0022 % 0023 % (c) Copyright Danilo P. Mandic 2009 0024 % http://www.commsp.ee.ic.ac.uk/~mandic 0025 % 0026 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0027 % This program is free software; you can redistribute it and/or modify 0028 % it under the terms of the GNU General Public License as published by 0029 % the Free Software Foundation; either version 2 of the License, or 0030 % (at your option) any later version. 0031 % 0032 % This program is distributed in the hope that it will be useful, 0033 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0034 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0035 % GNU General Public License for more details. 0036 % 0037 % You can obtain a copy of the GNU General Public License from 0038 % http://www.gnu.org/copyleft/gpl.html or by writing to 0039 % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 0040 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0041 % ........................................... 0042 function y = gngd(x,N,mu,C,rho) 0043 0044 M = 1;% prediction horizon 0045 L = length(x)-M; % length of simulation 0046 filterinput = zeros(N,L);%input of FIR 0047 filteroutput = zeros(1,L);%output of FIR 0048 learning = zeros(1,L);% the adaptive learning rate; 0049 Phi = zeros(N,1); 0050 WGNGD = zeros(N,1);% weight 0051 eGNGD = zeros(1,L);% error 0052 EGNGD = zeros(1,L);% mean square error 0053 filteroutput = zeros(1,L);% output 0054 0055 for i = 1:L 0056 for m = 1:N 0057 if (i-m+1)>0 0058 filterinput(m,i) = x(1,i-m+1); 0059 else 0060 filterinput(m,i) = 0; 0061 end 0062 end 0063 filteroutput(i) = transpose(filterinput(:,i)) * WGNGD;% 0064 eGNGD(i) = x(i+M) - filteroutput(i);% 0065 EGNGD(i) = 10 * log10(1/2 * eGNGD(i)' * eGNGD(i)); 0066 if i == 1 0067 C = C; 0068 else 0069 Phi = -1 * mu * eGNGD(i-1) * filterinput(:,i-1) / ((norm(filterinput(:,i-1)).^2 + C).^2); 0070 C= C + rho * eGNGD(i) * transpose(filterinput(:,i)) * Phi; 0071 end 0072 learning(i) = mu /(norm(filterinput(:,i))^2 + C); 0073 WGNGD = WGNGD + learning(i) * eGNGD(i) * filterinput(:,i); 0074 end 0075 y = filteroutput; 0076 0077 0078